package com.redhipps.hips.client.model;

import java.io.Serializable;

import com.google.gwt.json.client.JSONValue;

public class Key implements Serializable {

  private String key;

  public Key(String key) {
    this.key = key;
  }

  public Key(JSONValue value) {
    this(value.isString().stringValue());
  }

  @Override
  public int hashCode() {
    return key.hashCode();
  }

  @Override
  public boolean equals(Object o) {
    if (o instanceof Key) {
      return key.equals(((Key) o).key);
    }
    return false;
  }

  @Override
  public String toString() {
    return key;
  }
}
